package com.xiangge.es.pojo;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.DateFormat;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

import java.io.Serializable;
import java.util.Date;

/**
 * @author lsy_server
 */
@Data
@Document(indexName = "es-test2", type = "document2", shards = 5, replicas = 0)
public class ESDocument implements Serializable {

    @Id
    private String id;
    /**
     * 中文指定分词器
     */
    @Field(analyzer = "ik_smart", searchAnalyzer = "ik_smart")
    private String name;

    private String projectId;

    @Field(type = FieldType.Date)
    private Date addTime;
}